package cn.edu.zafu.bigdata.lhff;

public class Main {

    interface Movable {
        void move();
        void stop();
    }

    interface Resizable {
        void resize(double factor);
    }

    static class Car implements Movable {
        public void move() {
            System.out.println("The car is moving.");
        }

        public void stop() {
            System.out.println("The car has stopped.");
        }
    }

    static class ResizableCircle implements Movable, Resizable {
        private double radius;

        public ResizableCircle(double radius) {
            this.radius = radius;
        }

        public void move() {
            System.out.println("The circle is moving.");
        }

        public void stop() {
            System.out.println("The circle has stopped.");
        }

        public void resize(double factor) {
            radius *= factor;
            System.out.println("The new radius after resizing is: " + radius);
        }
    }

    public static void main(String[] args) {
        Movable car = new Car();
        car.move();
        car.stop();

        System.out.println();

        ResizableCircle circle = new ResizableCircle(6.0);
        circle.move();
        circle.stop();
        circle.resize(2.0);
    }
}

